package net.aiion.weave.impl.bytecode.events;

import net.aiion.weave.spi.bytecode.BytecodeVisitor;
import net.aiion.weave.spi.bytecode.events.ParameterAnnotationStartBytecodeEvent;

public class ParameterAnnotationStartBytecodeEventImpl extends BytecodeEventImpl implements
    ParameterAnnotationStartBytecodeEvent
{
    private int parameterIndex;
    private String descriptor;
    private boolean visible;

    public ParameterAnnotationStartBytecodeEventImpl(final int aParameterIndex, final String aDescriptor,
        final boolean aVisible)
    {
        parameterIndex = aParameterIndex;
        descriptor = aDescriptor;
        visible = aVisible;
    }

    @Override
    public int getType() {
        return PARAMETER_ANNOTATION_START;
    }

    @Override
    public void setParameterIndex(final int aParameterIndex) {
        parameterIndex = aParameterIndex;
    }

    @Override
    public int getParameterIndex() {
        return parameterIndex;
    }

    @Override
    public void setDescriptor(final String aDescriptor) {
        descriptor = aDescriptor;
    }

    @Override
    public String getDescriptor() {
        return descriptor;
    }

    @Override
    public void setVisible(final boolean aVisible) {
        visible = aVisible;
    }

    @Override
    public boolean getVisible() {
        return visible;
    }

    @Override
    public BytecodeVisitor acceptBytecodeVisitor(final BytecodeVisitor aBytecodeVisitor) {
        return aBytecodeVisitor.asBytecodeMethodVisitor().visitParameterAnnotationStart(this);
    }
}
